package spring.cloud.study;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * Hello world!
 *
 */

@EnableDiscoveryClient // 将该服务注册为Eureka客户端应用，获得服务发现的能力。
@EnableHystrix // 开启Hystrix的服务
//@EnableFeignClients	  //开启feign客户端调用支持
@SpringBootApplication
public class PayServerApplication {
	@Bean
	@LoadBalanced // 配置Ribbon负载均衡远程调用
	public RestTemplate restTemplate() {
		return new RestTemplate();
	}

	public static void main(String[] args) {
		SpringApplication.run(PayServerApplication.class, args);
	}
}
